<?php

namespace app\admin\model;

use think\Model;

class Cate extends Model
{
    public function getStatusAttr($value)
    {
      if ($value==1) {
        return '启用';
      }else {
          return '禁用';
      }

    }
    public function _update($data)
    {
      if (isset($data['id'])) {
        //修改
        return $this->save($data,['id'=>$data['id']]);
      }else {
        return $this->save($data);
      }
    }
}
